cmake_minimum_required(VERSION 3.16)

project(qtvision_editor VERSION 1.0 LANGUAGES CXX)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_AUTOUIC ON)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)

set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

find_package(QT NAMES Qt6 COMPONENTS Core Concurrent REQUIRED)
find_package(Qt${QT_VERSION_MAJOR} COMPONENTS Core Concurrent REQUIRED)

include_directories(${PROJECT_SOURCE_DIR}/../3rdlibs/tvision/include/)
include_directories(${PROJECT_SOURCE_DIR}/../3rdlibs/tvision/include/tvision/compat/borland/)


set(PRJ_SOURCES
    main.cpp
    editor/tvedit.h
    editor/tvedit1.cpp
    editor/tvedit2.cpp
    editor/tvedit3.cpp
)
if(CMAKE_SYSTEM_NAME MATCHES "Windows")
    link_directories(${PROJECT_SOURCE_DIR}/../3rdlibs/tvision/ucrt64)
    #link_directories(${PROJECT_SOURCE_DIR}/../3rdlibs/tvision/mingw64)
else()
	link_directories(${PROJECT_SOURCE_DIR}/../3rdlibs/tvision/linux64)
    set(LINUX_GPMCURSE curses gpm)
endif()

#############Target======================

add_executable(qtvision_editor
    ${PRJ_SOURCES}
   
)
target_link_libraries(qtvision_editor 
Qt${QT_VERSION_MAJOR}::Core
Qt${QT_VERSION_MAJOR}::Concurrent
tvision
${LINUX_GPMCURSE}
)

